<template >
          <div >
                <div class="header-box">{{electricItems.name}}</div>
                  <div class="isid" style="display:none">{{electricItems.deviceid}}</div>
                  <div class="header-content">
                      <el-tooltip class="switechbtn" :content="'当前状态:'+ [electricItems.isActive?'开':'关']" placement="bottom">
                        <el-switch  v-model="electricItems.isActive" active-color="#0080C0" inactive-color="#ff4949" @change="set_status1(electricItems.deviceid,electricItems.isActive,electricItems.name,electricIndex)"></el-switch>
                      </el-tooltip>
                      <el-badge v-if="electricItems.isnull" value="采集超时" ></el-badge>
                  </div>
          </div>
</template>
<script>
export default {
  name:'electric',
  props:["electricItems","electricIndex"],
  data () {
    return {
      
    }
  },
  methods: {
    set_status1(deviceid,status,name,index){
      this.$emit("electric-change",{deviceid,status,name,index})
    }
  }
}
</script>
<style scope>
</style>